<!doctype html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport"
        content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
</head>
<body>
<script>
  // 类的方式
  class Building {
    // 成员变量
    // 成员方法
    // 原型方法
      // constructor() {}
  }


  // 构造函数的方式
  function Point(x, y) {
    this.x = x
    this.y = y
  }

  Point.reset = function (point) {
    point.x = 0
    point.y = 0
  }

  Point.move = function (point, position) {
    point.x = position[0]
    point.y = position[1]
  }

  const p1 = new Point(10, 2)

  Point.move(p1, [3, 4])

  Point.reset(p1)

</script>
</body>
</html>
